package com.yun.entity;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

/**
 * 
 * @author zq
 *
 */
public interface UserRepository extends JpaRepository<User, Long> {

	User findByUserName(String userName);

	User findByUserNameAndAge(String userName, Integer age);

	@Query("from User u where u.userName=:userName")
	User findUser(@Param("userName") String userName);

}
